<?php

class Application_Form_AddElement extends Zend_Form
{

    public function init()
    {
       $this->setMethod('post');
        
        $this->addElement('text', 'url', array(
            'label'         => 'Url:',
            'required'      => false,
            'filters'       => array('StringTrim')    
        ));
        
        $this->addElement('file', 'file', array(
            'label'         => 'File:',
            'required'      => false,
        ));
        $this->file->addValidator('Extension', false, 'jpg,png,gif,torrent');
        $this->file->addValidator('Size', false, '102400');
        
        $this->addElement('select', 'category', array(
            'label'         => 'Category:',
            'required'      => true
        ));
        
        $db = new Application_Model_GroupMapper();
        $categories = $db->findAllcategorizing();
        foreach ($categories as $category) {
            $this->category->addMultiOption($category->id(), $category->name());
        }

        $this->addElement('submit', 'submit', array(
            'label'      => 'Continue',
            'required'      => false,
            'ignore'      => true
        ));
    }


}

